package com.hsnr.findyourbuddy;

import java.io.IOException;
import java.io.InputStream;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

public class BroadcastRequest extends Request {

    private static final long serialVersionUID = 1L;
    private String timestamp;

    public BroadcastRequest(String mobile) {
	super(ConversationTypes.CT_BROADCAST, mobile);
    }
    public BroadcastRequest() {
	super(ConversationTypes.CT_BROADCAST);
    }

    /**
     * @return the timestamp
     */
    public String getTimestamp() {
	return timestamp;
    }

    public static BroadcastRequest fromJSON(InputStream in) throws JsonParseException, JsonMappingException, IOException {
	ObjectMapper mapper = new ObjectMapper();
	mapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);
	BroadcastRequest r = mapper.readValue(in, BroadcastRequest.class);
	return r;
    }

   
}
